package com.lh.entity.table;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigInteger;
import java.util.Date;
import java.util.List;

@Data
@TableName( "file_directory")
public class FileDirectory {

    @TableId(value = "id", type = IdType.AUTO)
    private BigInteger id;

    /**
     * 目录名称
     */
     @TableField("directory_name")
    private String directoryName;

    /**
     * 父id
     */
     @TableField("parent_id")
    private BigInteger parentId;

    /**
     * 时候删除（0 = 未删除，1 = 已删除）
     */
     @TableField("is_deleted")
    private String isDeleted = "0";

    /**
     * 创建时间
     */
     @TableField("created_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @TableField("remark")
    private String remark;

    /**
     * 主id
     */
     @TableField("main_id")
    private Integer mainId;

    @TableField(exist = false)
    private List<FileDirectory> children;
}